import request from '@/config/axios'

// 计划面试专家 VO
export interface BatchSpecialistVO {
  id: number // 主键
  userId: number // 用户ID
  batchId: string // 计划ID
  remark: string // 备注
}

export interface BatchSpecialistSelectedRespVO {
  id: number // 主键
  userId: number // 用户ID
  batchId: string // 计划ID
  remark: string // 备注
  nickname: string // 教师姓名
  jobCode: string // 工号
  mobile: string // 手机号码
  deptName: string // 部门名称
  zcm: string // 职称码
  workingStatus: string // 工作状态
}

export interface BatchSpecialistSimpleListRespVO {
  userId: number // 专家userId
  nickname: string // 专家姓名
}

// 计划面试专家 API
export const BatchSpecialistApi = {
  // 查询计划面试专家分页
  getBatchSpecialistPage: async (params: any) => {
    return await request.get({ url: `/recruit/batch-specialist/page`, params })
  },

  // 查询计划面试专家详情
  getBatchSpecialist: async (id: number) => {
    return await request.get({ url: `/recruit/batch-specialist/get?id=` + id })
  },

  // 新增计划面试专家
  createBatchSpecialist: async (data: BatchSpecialistVO) => {
    return await request.post({ url: `/recruit/batch-specialist/create`, data })
  },

  // 修改计划面试专家
  updateBatchSpecialist: async (data: BatchSpecialistVO) => {
    return await request.put({ url: `/recruit/batch-specialist/update`, data })
  },

  // 删除计划面试专家
  deleteBatchSpecialist: async (id: number) => {
    return await request.delete({ url: `/recruit/batch-specialist/delete?id=` + id })
  },

  // 导出计划面试专家 Excel
  exportBatchSpecialist: async (params) => {
    return await request.download({ url: `/recruit/batch-specialist/export-excel`, params })
  },

  // 查询指定计划已选的招生导师分页
  getSelectedSpecialistByBatchId: async (params: any) => {
    return await request.get({ url: `/recruit/batch-specialist/get-batch`, params })
  },

  // 新增指定计划的计划招生导师
  addBatchSpecialist: async (batchId: string, data: Partial<BatchSpecialistVO>[]) => {
    return await request.post({ url: `/recruit/batch-specialist/add-batch/${batchId}`, data })
  },

  // 为指定计划移除招生导师
  removeBatchSpecialist: async (batchId: string, data: Partial<BatchSpecialistVO>[]) => {
    return await request.delete({ url: `/recruit/batch-specialist/remove-batch/${batchId}`, data })
  },

  // 获得指定计划计划面试专家下拉
  getBatchSpecialistSimpleList: async (batchId: string) => {
    return await request.get({ url: `/recruit/batch-specialist/simple-list?batchId=${batchId}` })
  }
}
